<?php

/**
 * modul actions.
 *
 * @package    sf_sandbox
 * @subpackage modul
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
 */
class modulActions extends sfActions
{
  /**
   * Executes index action
   *
   */
  public function executeIndex()
  {
    $this->forward('default', 'module');
  }
  
  public function executeWitajSwiecie(){
  	  	
  }
  
  public function executeWpiszPracownika(){
  	
  }
  
  public function executeDanePracownika(){
  	$this->nazwisko = $this->getRequestParameter('nazwisko');

	$request = $this->getRequest();
	$this->imie = $request->getParameter('imie');  	
  }
  
  public function executeFunkcja(){
  	
  }

  /* 2.6 */
  public function executeSprawdzFunkcje(){
  	switch($this->getRequestParameter('funkcja')){
  		case 'administrator':
  			return Administrator;
  		case 'redaktor':
  		case 'autor':
  			return sfView::SUCCESS;
  		default:
  			return sfView::ERROR;
  	}
  }  
  public function executeSprawdzUzytkownika(){

  	$aGoodUsers = array('kowalski', 'roszkowski', 'konopnicka', 'mickiewicz');
  	$sUser		= $this->getRequestParameter('user');
  	if (in_array($sUser, $aGoodUsers)) {
  		$this->redirect('modul/profil?user='.$sUser);
  	}
  	else{
  		$this->forward('modul','logowanie');	
  	}
  }
  public function executeProfil(){
  	$this->sUserName = $this->getRequestParameter('user');}  
  public function executeLogowanie(){
  }  
  public function executePokazTowar(){
  	if (!$this->hasRequestParameter('numer_towaru'))
  	$this->forward404();
  }
  /* 2.7 */
  public function execute2_7ONas(){
  	$this->tresc="Tutaj dowiesz się wszystkiego o naszej firmie";
  }  
  public function execute2_7Kontakt(){
  	$this->tresc="Nasze dane kontakowe !!!";
  }

  public function execute2_7Dojazd(){
  	$this->tresc="Tutaj doweisz się jak do nas dojechać";
  }
  
  public function execute2_7NasiKonsultanci(){
  	$this->tresc="Tutaj poznasz naszych pracowników";
  }
    
  public function preExecute(){
  	$this->menu=array(
  		array('o nas', '/modul/2_7ONas'),
  		array('kontakt', '/modul/2_7Kontakt'),
  		array('dojazd', '/modul/2_7Dojazd'),
  		array('nasi konsultanci', '/modul/2_7NasiKonsultanci')
  	);
  } 
  
  public function postExecute(){
  	$this->stopka='Copyright &copy; 2010 Moja Firma';  	
  } 
  
}